<template>
	<div class="demo2">
		<h1>我是Demo2组件，我兄弟给我的手机:{{ph}}</h1>
	</div>
</template>

<script>
	export default {
		name:'Demo2',
		data(){
			return {
				ph:''
			}
		},
		methods:{
			saveShouji(phone){
				this.ph = phone
			}
		},
		mounted(){
			this.$bus.$on('shouji',this.saveShouji)
		},
		beforeDestroy(){
			this.$bus.$off('shouji')
		}
	}
</script>

<style>
	.demo2{
		background-color: skyblue;
		padding: 10px;
	}
</style>